<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<script src="assets/js/qrcode.min.js"></script>
<style>
    .bootbox-close-button {
        width: 19px;
        height: 19px;
        border: none;
        cursor: pointer;
        -webkit-appearance: none;
        float: right;
        top: 4px;
        left: -5px;
        position: relative;
        background: #E9F5FF url("assets/img/nav-img/icon_close.png") no-repeat 0 0;
    }

    .bootbox .modal-dialog {
        width: 70% !important;
    }

    .modal-content {
        width: 100%;
    }

    .editForm>div {
         min-height: 0px;
    }

    input, select, .form-control {
        height: 30px;
    }

    .form-group input{
        border-radius: 5px!important;
    }
    .form-group textarea{
        border-radius: 5px!important;
    }

    .myDialogDetail label {
        margin-bottom: 0px !important;
    }

    .detailDialogStyle {
        line-height: 30px;
        margin-bottom: 15px;
    }
    .myDialogDetail1 .modal-body{
        padding-bottom: 0px!important;
        border-bottom-right-radius: 5px!important;
        border-bottom-left-radius: 5px!important;
    }

    .bootbox .modal-body {
        border-bottom-left-radius: 5px!important;
        border-bottom-right-radius: 5px!important;
        padding-bottom:0px!important;
    }
</style>
<div id="detailDiv">
    <div class="row " style="width: 100%;margin:auto 0;height: 50px;">
        <div class="col-xs-12 margin-top-10">
            <input type="hidden"  class="packageType" value="${packageType}"/>

            <#if packageType!=0>
                <div class="col-xs-1 nopadding submitBtn" style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=1]"/>
                </div>
                <#else>
                    <div class="col-xs-1 nopadding submitBtn" style="width: 100px;margin-right: 1px">
                        <@hp code="KHMD24277389291454-list_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=1]"/>
                    </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_package_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=2]"/>
                </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_class_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=3]"/>
                </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_attendance_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=4]"/>
                </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_addsubtract_Detai"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=5]"/>
                </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_receivables_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=6]"/>
                </div>
                <#else>
                    <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                        <@hp code="KHMD24277389291454-list_receivables_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=6]"/>
                    </div>

            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_refund_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=7]"/>
                </div>
                <#else>
                    <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                        <@hp code="KHMD24277389291454-list_refund_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=7]"/>
                    </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_followUp_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=8]"/>
                </div>
                <#else>
                    <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                        <@hp code="KHMD24277389291454-list_followUp_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=8]"/>
                    </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_history_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=9]"/>
                </div>
            </#if>


            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_postpone_detail"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=10]"/>
                </div>
            </#if>

            <#if packageType!=0>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="HYGL22644030125229-list_allocation"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=11]"/>
                </div>
                <#else>
                <div class="col-xs-1 nopadding " style="width: 100px;margin-right: 1px">
                    <@hp code="KHMD24277389291454-list_allocation"  params="[serializeNum=${serializeNum},targetDataId=${memberId},flag=11]"/>
                </div>
            </#if>
        </div>
    </div>
    <div class="row myDialogDetail myDialogDetai" style="margin-left:0px!important;">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <form class="editStudentForm editForm" action="${saveUrl}" method="post" responseType="JSON" role="form" style="margin-bottom: 0px!important;"
                  id="editForm_${serializeNum}"
                  data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
                  data-bv-message="This value is not valid"
                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                <div class="row"
                     style="margin-bottom: 15px;margin-top:15px;font-size: 14px;border-bottom: 1px solid #ccc;margin-left: 0px!important;">
                    <label style="font-size: 14px">
                        基础信息
                    </label>
                    <label class="pull-right">
                        <#if packageType==0>
                            <@hp code="KHMD24277389291454-edit"/>
                        </#if>
                        <#if packageType!=0>
                            <@hp code="HYGL22644030125229-edit"/>
                        </#if>

                        <button type="button" class="preserveBtn btn btn-blue float-right"
                                style="display: none;width: 100px;" id="editFormSubmitBtn_${serializeNum}" onclick="showJoinPerlation(this)">保存
                        </button>
                    </label>
                </div>

                <div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle" style="position: relative;z-index: 99;">
                    <div class="col-xm-5 col-sm-5 col-lg-5 hidden">
                        <div class="form-group">
                            <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right" >会员编号：</label>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                                ${(data.number???string(data.number?html,""))!''}
                            </div>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;max-width: 200px;">
                                <input type="text" class="form-control" value="${data.number}" readonly>
                            </div>
                        </div>
                    </div>
                    <div style="position: absolute;width: 170px;height: 180px;right: 0;top: -16px;border: 1px solid #ccc;">
                        <div class="col-xm-12 col-sm-12 col-lg-12 text-align-center">
                            会员二维码
                        </div>
                        <div class="col-xm-12 col-sm-12 col-lg-12 text-align-center">
                            <div id="qrcode" style="width: 107px;height: 107px;margin: 0 auto;"></div>
                        </div>
                        <div class="col-xm-12 col-sm-12 col-lg-12 text-align-center editShow margin-top-5" style="display: none;">
                            <input type="text" class="form-control" value="${data.quickMark}" readonly name="quickMark" style="width: 100px;margin: 0 auto;text-align: center">
                        </div>
                        <div class="col-xm-12 col-sm-12 col-lg-12 text-align-center editHide margin-top-5">
                            <div style="text-align: center">${data.quickMark}</div>
                        </div>
                    </div>
                </div>

                <div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
                    <div class="col-xm-5 col-sm-5 col-lg-5">
                        <div class="form-group">
                            <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">
                                <span style="color: red">*</span>客户姓名：</label>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                                ${(data.name???string(data.name?html,""))!''}
                            </div>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;max-width: 200px;">
                                <input hidden="hidden" name="id" value="${data.id}" id="id">
                                <input required="required" data-bv-message="请填写客户信息" name="name"
                                       alt="客户姓名" onkeyup="inputValueLength(this,'name')"
                                       id="name" placeholder="客户姓名" type="text" title="客户姓名"
                                       class="form-control"
                                       value="${data.name}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-xm-6 col-sm-6 col-lg-6">
                        <div class="form-group">
                            <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">昵称：</label>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                                ${(data.nickName???string(data.nickName?html,""))!''}
                            </div>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;max-width: 200px;">
                                <input data-bv-message="The field is not valid" name="nickName"
                                       alt="昵称" onkeyup="inputValueLength(this,'name')"
                                       id="nickName" placeholder="昵称" type="text" title="昵称"
                                       class="form-control"
                                       value="${data.nickName}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
                    <div class="col-xm-5 col-sm-5 col-lg-5">
                        <div class="form-group">
                            <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">性别：</label>
                            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                                <@dictionary groupCode="sex" dictionaryCode="${data.sex}" ;sex>${sex.value }</@dictionary>
                        </div>
                        <div class="col-xm-8 col-sm-8 col-lg-8-8 editShow nopadding-left" style="display: none;max-width: 200px;">
                            <#if data.sex == 1>
                                <label>
                                    <input type="radio" value="1"    name="sex" style="margin-right: 5px;opacity: 1;position: static;"
                                           checked="true">
                                </label>
                                <label style="margin-right: 10px">男</label>
                                <label>
                                    <input type="radio" name="sex" value="2"
                                           style="margin-right: 5px;opacity: 1;position: static;">
                                </label>
                                <label>女</label>
                            <#else>
                                <label>
                                    <input type="radio" value="1"    name="sex" style="margin-right: 5px;opacity: 1;position: static;">
                                </label>
                                <label style="margin-right: 10px">男</label>
                                <label>
                                    <input type="radio" name="sex" value="2" checked="true"
                                           style="margin-right: 5px;opacity: 1;position: static;">
                                </label>
                                <label>女</label>
                            </#if>
                        </div>
                    </div>
                </div>
                <div class="col-xm-6 col-sm-6 col-lg-6">
                    <div class="form-group">
                        <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">出生日期：</label>
                        <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                            ${(data.birthdayDate???string(data.birthdayDate?string('yyyy-MM-dd'),''))!''}
                        </div>
                        <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;max-width: 200px;">
                            <input data-bv-date-format="YYYY-MM-DD"
                                   data-bv-message="The field is not valid"
                                   data-bv-date-message="请正确输入一个时间" data-bv-date="true" size="10"
                                   name="birthdayDate" alt="出生日期" id="birthdayDate" placeholder="出生日期"
                                   type="text" title="出生日期"
                                   class="form-control form-control date-picker col-xs-12"
                                   onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})"
                                   value="${(data.birthdayDate???string(data.birthdayDate?string('yyyy-MM-dd'),''))!''}"/>
                        </div>
                    </div>
                </div>
        </div>

        <div class="col-xs-12 col-sm-12 col-lg-12 detailDialogStyle">
            <div class="form-group">
                <div class="col-xs-12 col-sm-12 col-lg-12">
                    <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right" style="max-width: 10%!important;">
                        <span style="color: red">*</span>家长信息：</label>
                    <div class="col-xs-9 col-sm-9 col-lg-9 editHide nopadding-left nopadding-right">
                        <#list data["pertainRelationList"] as cl>
                            <div>
                                <label>
                                    ${cl.patriarchName}
                                </label>
                                <label>
                                    <@dictionary groupCode="affiliationRelation" dictionaryCode="${cl.affiliationRelation}" ;affiliationRelation>${affiliationRelation.value }</@dictionary>
                                </label>
                                <label>
                                    ${cl.contactPhone}
                                </label>
                                <label>
                                    <@dictionary groupCode="positionType" dictionaryCode="${cl.positionType}" ;positionType>${positionType.value }</@dictionary>
                                </label>
                            </div>
                        </#list>
                    </div>
                    <div class="col-xs-9 col-sm-9 col-lg-9 editShow nopadding-left nopadding-right" style="display: none;">
                        <#list data["pertainRelationList"] as cl>
                            <div class="col-xs-12 col-sm-12 col-lg-12" id="circleHtml">
                                <div class="form-group circleHtml nomargin-bottom" style="padding-top: 10px!important;clear:both;">
                                    <div>
                                        <label class="col-xs-10 circleHtmlLabel nomargin-bottom " style="padding-left: 2px!important;">
                                            <label class="nomargin-bottom">
                                                <input required="required" data-bv-message="请填写家长姓名！" style="width: 200px"
                                                       alt="家长姓名" id="patriarchName" placeholder="家长姓名" type="text"
                                                       title="家长姓名" onkeyup="inputValueLength(this,'name')"
                                                       class="form-control patriarchName" value="${cl.patriarchName}"/>
                                            </label>
                                            <label class="nomargin-bottom">
                                                <select name="affiliationRelation" class="affiliationRelation" style="width: 87px!important;">
                                                    <@dictionary groupCode="affiliationRelation";dics>
                                                        <#list dics as dic>
                                                            <#if cl.affiliationRelation == dic.code>
                                                                <option value="${dic.code}" selected="selected">${dic.value}</option>
                                                            <#else>
                                                                <option value="${dic.code}">${dic.value}</option>
                                                            </#if>
                                                        </#list>
                                                    </@dictionary>
                                                </select>
                                            </label>
                                            <label class="nomargin-bottom">
                                                <input required="required" data-bv-message="请填写联系电话！" maxlength="11" style="width: 200px"
                                                       alt="联系电话" id="contactPhone" placeholder="联系电话" type="text"
                                                       title="联系电话" name="contactPhone"
                                                       class="form-control contactPhone"
                                                       value="${cl.contactPhone}"
                                                       data-bv-regexp="true" onkeyup="inputValueLength(this,'phone')"
                                                       data-bv-regexp-regexp="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$"
                                                       data-bv-regexp-message="请输入正确的联系电话!"
                                                       onblur="checkPhoneIsSame(this)" />
                                            </label>
                                            <label class="nomargin-bottom">
                                                <select name="positionType" class="positionType">
                                                    <@dictionary groupCode="positionType";dics>
                                                    <#list dics as dic>
                                                        <#if cl.positionType == dic.code>
                                                            <option value="${dic.code}" selected="selected">${dic.value}</option>
                                                        <#else>
                                                            <option value="${dic.code}">${dic.value}</option>
                                                        </#if>
                                                    </#list>
                                                </@dictionary>
                                                </select>
                                            </label>
                                            <label class="nomargin-bottom padding-left-10">
                                                <#if cl_index == 0>
                                                    <div onclick="clickAdd()" style="width: 22px;height: 22px;background: url('assets/img/nav-img/icon_add.png');">
                                                    </div>
                                                <#else>
                                                    <div class="circle11" onclick="removeCircleHtml(this)" style="width: 22px;height: 22px;background: url('assets/img/nav-img/icon_hidden..png');"></div>
                                                </#if>
                                            </label>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </#list>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-lg-12 detailDialogStyle">
            <div class="form-group">
                <div class="col-xm-5 col-sm-5 col-lg-5">
                    <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">微信号：</label>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                        ${(data.weiChat???string(data.weiChat?html,""))!''}
                    </div>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                        <input data-bv-message="The field is not valid" name="weiChat"
                               alt="微信号" onkeyup="inputValueLength(this,'WeChat')"
                               id="weiChat" placeholder="微信号" type="text" title="微信号"
                               class="form-control"
                               value="${data.weiChat}"/>
                        <span class="text"></span>
                    </div>
                </div>
                <div class="col-xm-6 col-sm-6 col-lg-6">
                    <label class="col-xm-3 col-sm-3 col-lg-3 control-label no-padding-right no-padding-left text-right">固定电话：</label>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                        ${(data.telePhone???string(data.telePhone?html,""))!''}
                    </div>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                        <input data-bv-message="The field is not valid" name="telePhone"
                               alt="固定电话" onkeyup="inputValueLength(this,'telePhone')"
                               id="telePhone" placeholder="固定电话" type="text" title="固定电话"
                               class="form-control"
                               value="${data.telePhone}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-xs-12 col-sm-12 col-lg-12 detailDialogStyle">
            <div class="col-xs-12 col-sm-12 col-lg-12">
                <label class="col-xs-12 col-sm-12 col-lg-12 control-label no-padding-right no-padding-left text-right" style="max-width: 10% !important;">家庭住址：</label>
                <div class="col-xs-9 editHide nopadding-left nopadding-right">
                    <label>
                        <@citys cityIds=(data.addressProvince???string(data.addressProvince?html,""))!'' ;citys>
                        <#list citys as city>
                            ${city.name }
                        </#list>
                    </@citys>
                    </label>
                    <label>
                        <@citys cityIds=(data.addressCity???string(data.addressCity?html,""))!'' ;citys>
                        <#list citys as city>
                            ${city.name }
                        </#list>
                    </@citys>
                    </label>
                    <label>
                        <@citys cityIds=(data.addressRegion???string(data.addressRegion?html,""))!'' ;citys>
                        <#list citys as city>
                            ${city.name }
                        </#list>
                    </@citys>
                    </label>
                    <label>
                        ${(data.familyAddress???string(data.familyAddress?html,""))!''}
                    </label>
                </div>
                <div class="col-xs-9 editShow nopadding-left nopadding-right" style="display: none;" >
                    <div class="form-group nomargin-bottom" >
                        <label class="nomargin-bottom">

                            <select name="addressProvince" id="addressProvince" value="${data.addressProvince}" class="addressProvince col-xs-12 col-md-12 col-lg-12 nopadding">
                                <option value="">请选择</option>
                            </select>
                        </label>
                        <label>
                            省
                        </label>
                        <label class="nomargin-bottom">
                            <select name="addressCity" id="addressCity" value="${data.addressCity}" class="addressCity col-xs-12 col-md-12 col-lg-12 nopadding">
                                <option  value="">请选择</option>
                            </select>
                        </label>
                        <label class="nomargin-bottom">
                            <select name="addressRegion" id="addressRegion" value="${data.addressRegion}" class="addressRegion col-xs-12 col-md-12 col-lg-12 nopadding">
                                <option  value="">请选择</option>
                            </select>
                        </label>
                        <label>

                            市/区
                        </label>
                        <label class="nomargin-bottom">
                            <input data-bv-message="The field is not valid" style="max-width: 240px"
                                   name="familyAddress" onkeyup="inputValueLength(this,50)"
                                   alt="家庭住址" id="familyAddress" placeholder="家庭住址" type="text"
                                   title="家庭住址"
                                   class="form-control" value="${data.familyAddress}"/>
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-lg-12 detailDialogStyle">
            <div class="form-group">
                <label class="col-xs-2 col-sm-2 col-lg-2 control-label no-padding-right no-padding-left text-right" style="max-width: 10% !important;">备注：</label>
                <div class="col-xs-8 col-sm-8 col-lg-8 editHide nopadding-left nopadding-right">
                    ${(data.remark???string(data.remark?html,""))!''}
                </div>
                <div class="col-xs-8 col-sm-8 col-lg-8 editShow nopadding-left nopadding-right" style="display: none;" >
                            <textarea class="form-control" name="remark" rows="2" id="remark" onkeyup="inputValueLength(this,200)"
                                      style="resize:none">${data.remark}</textarea>
                </div>
            </div>
        </div>
        <div class="row" style="margin-bottom: 15px;margin-top:15px;font-size: 14px;border-bottom: 1px solid #ccc;margin-left: 0px!important;clear: both;height: 33.3px;">
            <label style="font-size: 14px">
                高级信息
            </label>
        </div>
        <div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
            <div class="form-group">
                <div class="col-xm-6 col-sm-6 col-lg-6">
                    <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">客户来源：</label>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                        <@dictionary groupCode="channelSource" dictionaryCode="${data.channelSource}" ;channelSource>${channelSource.value }</@dictionary>
                </div>
                <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                    <select id="channelSource" name="channelSource" class="col-xs-12">
                        <option value="">请选择</option>
                        <@dictionary groupCode="channelSource";dics>
                        <#list dics as dic>
                            <#if data.channelSource == dic.code>
                                <option value="${dic.code}" selected>${dic.value}</option>
                                <#else>
                                    <option value="${dic.code}">${dic.value}</option>
                            </#if>

                        </#list>
                    </@dictionary>
                    </select>
                </div>
            </div>
            <div class="col-xm-6 col-sm-6 col-lg-6">
                <div class="form-group">
                    <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">需要程度：</label>
                    <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                        <@dictionary groupCode="demanDegree" dictionaryCode="${data.demanDegree}" ;demanDegree>${demanDegree.value }</@dictionary>
                </div>
                <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                    <select id="demanDegree" name="demanDegree" class="col-sm-12">
                        <option value="">请选择</option>
                        <@dictionary groupCode="demanDegree";dics>
                        <#list dics as dic>
                            <#if data.demanDegree == dic.code>
                                <option value="${dic.code}" selected>${dic.value}</option>
                                <#else>
                                    <option value="${dic.code}">${dic.value}</option>
                            </#if>
                        </#list>
                    </@dictionary>
                    </select>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
    <div class="form-group">
        <div class="col-xm-6 col-sm-6 col-lg-6">
            <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">宝宝性格：</label>
            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                ${(data.characters???string(data.characters?html,""))!''}
            </div>
            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                <input data-bv-message="The field is not valid" name="characters"
                       alt="性格" onkeyup="inputValueLength(this,20)"
                       id="characters" placeholder="性格" type="text" title="性格"
                       class="form-control"
                       value="${data.characters}"/>
                <span class="text"></span>
            </div>
        </div>
        <div class="col-xm-6 col-sm-6 col-lg-6">
            <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">是否转介绍：</label>
            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                <#if data.isTurnIntroduce==true>
                    是
                </#if>
                <#if data.isTurnIntroduce==false>
                    否
                </#if>
            </div>
            <div class="col-xm-8 col-sm-8 col-lg-8-8 editShow nopadding-left" style="display: none;width: 200px;">
                <select id="isTurnIntroduce" name="isTurnIntroduce" class="col-sm-12">
                    <option value="">请选择</option>
                    <@dictionary groupCode="isTurnIntroduce";dics>
                    <#list dics as dic>
                        <#if data.isTurnIntroduce == true>
                            <#assign isTrue="1"/>
                            <#else>
                                <#assign isTrue="0"/>
                        </#if>
                        <#if isTrue == dic.code>
                            <option value="${dic.code}" selected>${dic.value}</option>
                            <#else>
                                <option value="${dic.code}" >${dic.value}</option>
                        </#if>
                    </#list>
                </@dictionary>
                </select>
            </div>
        </div>
    </div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
    <div class="form-group">
        <div class="col-xm-6 col-sm-6 col-lg-6">
            <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">调查问卷：</label>
            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                <#if data.isFinishQuestionnaire==true>
                    已完成
                </#if>
                <#if data.isFinishQuestionnaire==false>
                    未完成
                </#if>
            </div>
            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                <select id="isFinishQuestionnaire" name="isFinishQuestionnaire" class="col-sm-12">
                    <option value="">请选择</option>
                    <@dictionary groupCode="isFinishQuestionnaire";dics>
                    <#list dics as dic>
                        <#if data.isTurnIntroduce == true>
                            <#assign isTrue="1"/>
                            <#else>
                                <#assign isTrue="0"/>
                        </#if>
                        <#if isTrue == dic.code>
                            <option value="${dic.code}" selected>${dic.value}</option>
                            <#else>
                                <option value="${dic.code}" >${dic.value}</option>
                        </#if>
                    </#list>
                </@dictionary>
                </select>
            </div>
        </div>
        <div class="col-xm-6 col-sm-6 col-lg-6">
            <label class="col-xm-4 col-sm-4 col-lg-4 control-label no-padding-right no-padding-left text-right">是否参加过早教课程：</label>
            <div class="col-xm-8 col-sm-8 col-lg-8 editHide nopadding-left">
                <#if data.isJoinEarlyEducationCourse==true>
                    是
                </#if>
                <#if data.isJoinEarlyEducationCourse==false>
                    否
                </#if>
            </div>
            <div class="col-xm-8 col-sm-8 col-lg-8 editShow nopadding-left" style="display: none;width: 200px;">
                <select id="isJoinEarlyEducationCourse" name="isJoinEarlyEducationCourse" class="col-sm-12">
                    <option value="">请选择</option>
                    <@dictionary groupCode="isJoinEarlyEducationCourse";dics>
                    <#list dics as dic>
                        <#if data.isJoinEarlyEducationCourse == true>
                            <#assign isTrue="1"/>
                            <#else>
                                <#assign isTrue="0"/>
                        </#if>
                        <#if isTrue == dic.code>
                            <option value="${dic.code}" selected>${dic.value}</option>
                            <#else>
                                <option value="${dic.code}" >${dic.value}</option>
                        </#if>
                    </#list>
                </@dictionary>
                </select>
            </div>
        </div>
    </div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12 detailDialogStyle">
    <div class="form-group">
        <label class="col-xm-2 col-sm-2 col-lg-2 control-label text-right">客户评估：</label>
        <div class="col-xm-10 col-sm-10 col-lg-10 editHide nopadding-left">
            <@dictionary groupCode="clientAssess";dics>
            <#list dics as dic>
                <#assign checked="no"/>
                <#if data.clientAssess??>
                    <#list data.clientAssess?split(',') as curse>
                        <#if curse==dic.code>
                            <#assign checked="yes"/>
                        </#if>
                    </#list>
                </#if>
                <label class="nomargin">
                    <label>
                        <input type="checkbox" value="${dic.code}" disabled
                               style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                    </label>
                    <label style="margin-right: 10px">${dic.value}</label>
                </label>
            </#list>
        </@dictionary>
    </div>
    <div class="col-xm-10 col-sm-10 col-lg-10 editShow nopadding-left" style="display: none;">
        <@dictionary groupCode="clientAssess";dics>
        <#list dics as dic>
            <#assign checked="no"/>
            <#if data.clientAssess??>
                <#list data.clientAssess?split(',') as curse>
                    <#if curse==dic.code>
                        <#assign checked="yes"/>
                    </#if>
                </#list>
            </#if>
            <label class="nomargin">
                <label>
                    <input type="checkbox" name="clientAssessChk" value="${dic.code}"
                           style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                </label>
                <label style="margin-right: 10px">${dic.value}</label>
            </label>
        </#list>
    </@dictionary>
</div>
</div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12  detailDialogStyle">
    <div class="form-group">
        <label class="col-xm-2 col-sm-2 col-lg-2 control-label text-right">入园方式：</label>
        <div class="col-xm-10 col-sm-10 col-lg-10 editHide nopadding-left">
            <@dictionary groupCode="joinSchoolWay";dics>
            <#list dics as dic>
                <#assign checked="no"/>
                <#if data.joinSchoolWay??>
                    <#list data.joinSchoolWay?split(',') as curse>
                        <#if curse==dic.code>
                            <#assign checked="yes"/>
                        </#if>
                    </#list>
                </#if>
                <label class="nomargin">
                    <label>
                        <input type="checkbox"  value="${dic.code}" disabled
                               style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                    </label>
                    <label style="margin-right: 10px">${dic.value}</label>
                </label>
            </#list>
        </@dictionary>
    </div>
    <div class="col-xm-10 col-sm-10 col-lg-10 editShow nopadding-left" style="display: none;">
        <@dictionary groupCode="joinSchoolWay";dics>
        <#list dics as dic>
            <#assign checked="no"/>
            <#if data.joinSchoolWay??>
                <#list data.joinSchoolWay?split(',') as curse>
                    <#if curse==dic.code>
                        <#assign checked="yes"/>
                    </#if>
                </#list>
            </#if>
            <label class="nomargin">
                <label>
                    <input type="checkbox" name="joinSchoolWayChk" value="${dic.code}"
                           style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                </label>
                <label style="margin-right: 10px">${dic.value}</label>
            </label>
        </#list>
    </@dictionary>
</div>
</div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12  detailDialogStyle">
    <div class="form-group">
        <label class="col-xm-2 col-sm-2 col-lg-2 control-label text-right">选择机构因素：</label>
        <div class="col-xm-10 col-sm-10 col-lg-10 editHide nopadding-left">
            <@dictionary groupCode="organizationElement";dics>
            <#list dics as dic>
                <#assign checked="no"/>
                <#if data.organizationElement??>
                    <#list data.organizationElement?split(',') as curse>
                        <#if curse==dic.code>
                            <#assign checked="yes"/>
                        </#if>
                    </#list>
                </#if>
                <label class="nomargin">
                    <label>
                        <input type="checkbox" value="${dic.code}" disabled
                               style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                    </label>
                    <label style="margin-right: 10px">${dic.value}</label>
                </label>
            </#list>
        </@dictionary>
    </div>
    <div class="col-xm-10 col-sm-10 col-lg-10 editShow nopadding-left" style="display: none;">
        <@dictionary groupCode="organizationElement";dics>
        <#list dics as dic>
            <#assign checked="no"/>
            <#if data.organizationElement??>
                <#list data.organizationElement?split(',') as curse>
                    <#if curse==dic.code>
                        <#assign checked="yes"/>
                    </#if>
                </#list>
            </#if>
            <label class="nomargin">
                <label>
                    <input type="checkbox" name="organizationElementChk" value="${dic.code}"
                           style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                </label>
                <label style="margin-right: 10px">${dic.value}</label>
            </label>
        </#list>
    </@dictionary>
</div>
</div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12  detailDialogStyle">
    <div class="form-group">
        <label class="col-xm-2 col-sm-2 col-lg-2 control-label text-right">关注潜能开发：</label>
        <div class="col-xm-10 col-sm-10 col-lg-10 editHide nopadding-left">
            <@dictionary groupCode="potencyExploit";dics>
            <#list dics as dic>
                <#assign checked="no"/>
                <#if data.potencyExploit??>
                    <#list data.potencyExploit?split(',') as curse>
                        <#if curse==dic.code>
                            <#assign checked="yes"/>
                        </#if>
                    </#list>
                </#if>
                <label class="nomargin">
                    <label>
                        <input type="checkbox"  value="${dic.code}" disabled
                               style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                    </label>
                    <label style="margin-right: 10px">${dic.value}</label>
                </label>
            </#list>
        </@dictionary>
    </div>
    <div class="col-xm-10 col-sm-10 col-lg-10 editShow nopadding-left" style="display: none;">
        <@dictionary groupCode="potencyExploit";dics>
        <#list dics as dic>
            <#assign checked="no"/>
            <#if data.potencyExploit??>
                <#list data.potencyExploit?split(',') as curse>
                    <#if curse==dic.code>
                        <#assign checked="yes"/>
                    </#if>
                </#list>
            </#if>
            <label class="nomargin">
                <label>
                    <input type="checkbox" name="potencyExploitChk" value="${dic.code}"
                           style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                </label>
                <label style="margin-right: 10px">${dic.value}</label>
            </label>
        </#list>
    </@dictionary>
</div>
</div>
</div>

<div class="col-xm-12 col-sm-12 col-lg-12  detailDialogStyle" >
    <div class="form-group">
        <label class="ol-xm-2 col-sm-2 col-lg-2 control-label text-right">感兴趣的课程：</label>
        <div class="col-xm-10 col-sm-10 col-lg-10 editHide nopadding-left">
            <@dictionary groupCode="interstedCourse";dics>
            <#list dics as dic>
                <#assign checked="no"/>
                <#if data.interstedCourse??>
                    <#list data.interstedCourse?split(',') as curse>
                        <#if curse==dic.code>
                            <#assign checked="yes"/>
                        </#if>
                    </#list>
                </#if>
                <label class="nomargin">
                    <label>
                        <input type="checkbox" value="${dic.code}" disabled
                               style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                    </label>
                    <label style="margin-right: 10px">${dic.value}</label>
                </label>
            </#list>
        </@dictionary>
    </div>
    <div class="col-xm-10 col-sm-10 col-lg-10 editShow nopadding-left" style="display: none;">
        <@dictionary groupCode="interstedCourse";dics>
        <#list dics as dic>
            <#assign checked="no"/>
            <#if data.interstedCourse??>
                <#list data.interstedCourse?split(',') as curse>
                    <#if curse==dic.code>
                        <#assign checked="yes"/>
                    </#if>
                </#list>
            </#if>
            <label class="nomargin">
                <label>
                    <input type="checkbox" name="interstedCourseChk" value="${dic.code}"
                           style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" <#if checked=='yes'>checked="checked"</#if> >
                </label>
                <label style="margin-right: 10px">${dic.value}</label>
            </label>
        </#list>
    </@dictionary>
</div>
</div>
</div>
<input type="hidden" name="pertainRelationList">
<input type="hidden" name="clientAssess">
<input type="hidden" name="joinSchoolWay">
<input type="hidden" name="organizationElement">
<input type="hidden" name="potencyExploit">
<input type="hidden" name="interstedCourse">

<!--<div class="col-xm-12 col-sm-12 col-lg-12 margin-bottom-20">-->
<!--<label class="col-sm-2 col-sm-offset-2 control-label no-padding-right text-right"-->
<!--style="line-height: 34px;">所属城区：</label>-->
<!--<div class="col-sm-6 editHide" style="line-height: 34px;">-->
<!--${(data.addressRegion???string(data.addressRegion?html,"未设置"))!'未设置'}-->
<!--</div>-->
<!--<div class="col-sm-6 editShow" style="display: none;">-->
<!--<select class="col-sm-4">-->
<!--<option value="">1</option>-->
<!--</select>-->
<!--<select class="col-sm-4">-->
<!--<option value="">1</option>-->
<!--</select>-->
<!--<select class="col-sm-4">-->
<!--<option value="">1</option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->



<!--<div class="col-xm-12 col-sm-12 col-lg-12 margin-bottom-20">-->
<!--<label class="col-sm-2 col-sm-offset-2 control-label no-padding-right text-right" style="line-height: 34px;">会员邀请码：</label>-->
<!--<div class="col-sm-6 editHide" style="line-height: 34px;">1</div>-->
<!--<div class="col-sm-6 editShow" style="display: none;">-->
<!--<input type="text" class="form-control"/>-->
<!--</div>-->
<!--</div>-->

<!--<div class="col-xm-12 col-sm-12 col-lg-12 margin-bottom-20">-->
<!--<label class="col-sm-2 col-sm-offset-2 control-label no-padding-right text-right" style="line-height: 34px;">会员邀请码：</label>-->
<!--<div class="col-sm-6 editHide" style="line-height: 34px;">-->
<!--<img src="http://placehold.it/107x107" alt="">-->
<!--</div>-->
<!--<div class="col-sm-6 editShow" style="display: none;">-->
<!--<input type="text" class="form-control"/>-->
<!--</div>-->
<!--</div>-->
</form>
</div>
<div class="row bootbox-footer" style="height: 44px;background-color: #f5f5f5;margin-right: -15px;border-bottom-right-radius: 5px!important;border-bottom-left-radius: 5px!important;clear: both;"></div>
</div>
</div>

<script>

    // 会员二维码
    // 设置 qrcode 参数
    var qrcode = new QRCode('qrcode', {
        text: '${data.quickMark}',
        width: 107,
        height: 107,
        colorDark: '#000000',
        colorLight: '#ffffff',
        correctLevel: QRCode.CorrectLevel.H
    });

    $(".editBtn").click(function () {
        $(".editShow").show();
        $(".editHide").hide();
        $(this).hide();
        $(".preserveBtn").show();
        return false
    })

    $(".preserveBtn").click(function () {
        $(".editShow").hide();
        $(".editHide").show();
        $(this).hide();
        $(".editBtn").show();
    })

    function checkPhoneIsSame(that) {
        var contractPhone = $(that).val();
        ajaxRequest("tssStudentController/checkPhoneIsSame.do", {
            contractPhone:contractPhone
        }, function (result) {
            if (result.resCode == 301) {
                logger.error(result.resMsg);
                $(".contactPhone").val("");
                $(".submitBtn").attr("disabled",true)
            } else {
                $(".submitBtn").attr("disabled",false)
            }
        }, function () {
            logger.error("请求失败!");
        }, "get", "json")
    };


    function showMemberDetailById(that) {
        var serializeNum = $(that).attr("serializeNum");
        var targetdataId = $(that).attr("targetDataId");
        var flag = $(that).attr("flag");
        $(".chooseDetailBtn").each(function () {
            if ($(this).attr("flag") == flag) {
                $(this).css("background-color", "#5db2ff");
                $(this).css("color", "#fff");
            } else {
                $(this).css("background-color", "#fff");
                $(this).css("color", "#000");
            }
        })
        var type = $(".packageType").val();
        ajaxRequest("tssStudentController/getMemberDetailById.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: type,
            flag: flag,
        }, function (html) {
            var size = $("#detailDiv").find(".myDialogDetai" + flag).size();
            if (flag == 1) {
                $("#detailDiv").remove();
                $(".bootbox-body").append(html);

            } else {
                if (size == 0) {
                    $("#detailDiv").append(html);
                    $("#detailDiv").find(".myDialogDetai").each(function () {
                        var myDialogDetai = "myDialogDetai" + flag;
                        if(flag==7){
                            myDialogDetai = "myDialogDetai7";
                        }
                        if ($(this).attr("class").split(" ").indexOf(myDialogDetai) < 0) {
                            $(this).remove();
                        }
                    })
                }

            }

        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    }


    var html = '<div class="form-group circleHtml nomargin-bottom" style="padding-top: 10px!important;clear:both;">\n' +
        '                                <div>\n' +
        '                                    <label class="col-xs-10 circleHtmlLabel nomargin-bottom " style="padding-left: 2px!important;">\n' +
        '                                        <label class="nomargin-bottom">\n' +
        '                                            <input required="required" data-bv-message="请填写家长姓名！" maxlength="12" style="width: 200px"\n' +
        '                                                   alt="家长姓名" id="patriarchName" placeholder="家长姓名" type="text"\n' +
        '                                                   title="家长姓名"\n' +
        '                                                   class="form-control patriarchName">\n' +
        '                                        </label>\n' +
        '                                        <label class="nomargin-bottom">\n' +
        '                                            <select name="affiliationRelation" class="affiliationRelation" style="width: 87px!important;">\n' +
        '                                                <option >关系</option>\n' +
        '                                                <@dictionary groupCode="affiliationRelation";dics>\n' +
        '                                                <#list dics as dic>\n' +
        '                                                    <option value="${dic.code}">${dic.value}</option>\n' +
        '                                                </#list>\n' +
        '                                            </@dictionary>\n' +
        '                                            </select>\n' +
        '                                        </label>\n' +
        '                                        <label class="nomargin-bottom">\n' +
        '                                            <input required="required" data-bv-message="请填写联系电话！" maxlength="11" style="width: 200px"\n' +
        '                                                   alt="联系电话" id="contactPhone" placeholder="联系电话" type="text"\n' +
        '                                                   title="联系电话"\n' +
        '                                                   class="form-control contactPhone"\n' +
        '                                                    />\n' +
        '                                        </label>\n' +
        '                                        <label class="nomargin-bottom">\n' +
        '                                            <select name="positionType" class="positionType">\n' +
        '                                                <@dictionary groupCode="positionType";dics>\n' +
        '                                                <#list dics as dic>\n' +
        '                                                    <option value="${dic.code}">${dic.value}</option>\n' +
        '                                                </#list>\n' +
        '                                            </@dictionary>\n' +
        '                                            </select>\n' +
        '                                        </label>\n' +
        '                                        <label class="nomargin-bottom padding-left-10">\n' +
        '                                            <div class="circle11" onclick="removeCircleHtml(this)" style="width: 22px;height: 22px;background: url(\'assets/img/nav-img/icon_hidden..png\');">\n' +
        '                                            </div>\n' +
        '                                        </label>\n' +
        '                                    </label>\n' +
        '                                </div>\n' +
        '                            </div>'


    function clickAdd() {
        if($('.circleHtml').length == 5){

        } else {
            $('#circleHtml').append(html);
        }
    }

    function removeCircleHtml(that) {
        $(that).parent().parent().parent().parent().remove();
    }

    /**
     * 获取省
     */
    $(function () {
        ajaxRequest("sysCitysController/provinceList.do", null, function (result) {
            var data = result.data;
            var arr = ['<option value="">请选择</option>'];
            var value = $("#addressProvince").attr('value');
            $.each(data, function (i, t) {
                if(value == t.id){
                    arr.push('<option value="' + t.id + '" selected="selected">' + t.name + '</option>')
                } else {
                    arr.push('<option value="' + t.id + '">' + t.name + '</option>')
                }
            })
            if(value){
                ajaxRequest("sysCitysController/getChildrens.do", {
                    pId: value
                }, function (result) {
                    var data = result.data;
                    var arr = ['<option value="">请选择</option>'];
                    var value = $("#addressCity").attr('value');
                    $.each(data, function (i, t) {
                        if(value == t.id){
                            arr.push('<option value="' + t.id + '" selected="selected">' + t.name + '</option>')
                        } else {
                            arr.push('<option value="' + t.id + '">' + t.name + '</option>')
                        }
                    })
                    if(value){
                        ajaxRequest("sysCitysController/getChildrens.do", {
                            pId: value
                        }, function (result) {
                            var data = result.data;
                            var arr = ['<option value="">请选择</option>'];
                            var value = $("#addressRegion").attr('value');
                            $.each(data, function (i, t) {
                                if(value == t.id){
                                    arr.push('<option value="' + t.id + '" selected="selected">' + t.name + '</option>')
                                } else {
                                    arr.push('<option value="' + t.id + '">' + t.name + '</option>')
                                }
                            })
                            $(".addressRegion").html(arr.join(''))

                        }, function () {
                            ajaxError("加载城市失败")
                        }, "get", "json")
                    }
                    $(".addressCity").html(arr.join(''))

                }, function () {
                    ajaxError("加载城市失败")
                }, "get", "json")
            }
            $(".addressProvince").html(arr.join(''))
        }, function () {
            ajaxError("加载城市失败");
        }, "get", "json")
    });

    /**
     * 获取市
     */
    $(".addressProvince").change(function () {
        var nowSelectedProvince = $(this).val();
        ajaxRequest("sysCitysController/getChildrens.do", {
            pId: nowSelectedProvince
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="">请选择</option>'];
            $.each(data, function (i, t) {
                arr.push('<option value="' + t.id + '">' + t.name + '</option>')
            })
            $(".addressCity").html(arr.join(''))

        }, function () {
            ajaxError("加载城市失败")
        }, "get", "json")
    });

    /**
     * 获取区
     */
    $(".addressCity").change(function () {
        var nowSelectedProvince = $(this).val();
        ajaxRequest("sysCitysController/getChildrens.do", {
            pId: nowSelectedProvince
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="">请选择</option>'];
            $.each(data, function (i, t) {
                arr.push('<option value="' + t.id + '">' + t.name + '</option>')
            })
            $(".addressRegion").html(arr.join(''))

        }, function () {
            ajaxError("加载城市失败")
        }, "get", "json")
    });

    /**
     * 提交
     */
    function showJoinPerlation(that) {
        //家长信息
        var arr = $(".circleHtml");
        var obj = [];
        for(var i=0;i<arr.length;i++) {
            var patriarchName = arr.eq(i).find('.circleHtmlLabel').find(".patriarchName").val();
            var affiliationRelation = arr.eq(i).find('.circleHtmlLabel').find(".affiliationRelation").val();
            var contactPhone = arr.eq(i).find('.circleHtmlLabel').find(".contactPhone").val();
            var positionType = arr.eq(i).find('.circleHtmlLabel').find(".positionType").val();
            var person = {};
            person.patriarchName = patriarchName;
            person.affiliationRelation = affiliationRelation;
            person.contactPhone = contactPhone;
            person.positionType = positionType;
            obj.push(person);
        }
        var newObj = JSON.stringify(obj);
        console.log(newObj)
        $("[name='pertainRelationList']").val(newObj);
        //获取客户评估选中值
        var clientAssess = new Array();
        $("[name='clientAssessChk']:checked").map(function (index, chk) {
            var value = chk.value;
            clientAssess.push(value);
        });
        var clientAssessStr = clientAssess.join(",");
        $("[name='clientAssess']").val(clientAssessStr);
        //获取入园方式选中值
        var joinSchoolWay = new Array();
        $("[name='joinSchoolWayChk']:checked").map(function (index, chk) {
            var value = chk.value;
            joinSchoolWay.push(value);
        });
        var joinSchoolWayStr = joinSchoolWay.join(",");
        $("[name='joinSchoolWay']").val(joinSchoolWayStr);
        //获取选择机构元素选中值
        var organizationElement = new Array();
        $("[name='organizationElementChk']:checked").map(function (index, chk) {
            var value = chk.value;
            organizationElement.push(value);
        });
        var organizationElementStr = organizationElement.join(",");
        $("[name='organizationElement']").val(organizationElementStr);
        //获取关注潜能开发选中值
        var potencyExploit = new Array();
        $("[name='potencyExploitChk']:checked").map(function (index, chk) {
            var value = chk.value;
            potencyExploit.push(value);
        });
        var potencyExploitStr = potencyExploit.join(",");
        $("[name='potencyExploit']").val(potencyExploitStr);
        //获取感兴趣的课程选中值
        var interstedCourse = new Array();
        $("[name='interstedCourseChk']:checked").map(function (index, chk) {
            var value = chk.value;
            interstedCourse.push(value);
        });
        var interstedCourseStr = interstedCourse.join(",");
        $("[name='interstedCourse']").val(interstedCourseStr);

        var quickMark = $("[name='quickMark']").val();
        var id = $("#id").val();
        var name = $("#name").val();
        var nickName = $("#nickName").val();
        var sex = $("[name='sex']:checked").val();
        var birthdayDate = $("#birthdayDate").val();
        var pertainRelationList = $("[name='pertainRelationList']").val();
        var weiChat = $("#weiChat").val();
        var telePhone = $("#telePhone").val();
        var addressProvince = $("#addressProvince").val();
        var addressCity = $("#addressCity").val();
        var addressRegion = $("#addressRegion").val();
        var familyAddress = $("#familyAddress").val();
        var remark = $("#remark").val();
        var channelSource = $("#channelSource").val();
        var demanDegree = $("#demanDegree").val();
        var characters = $("#characters").val();
        var isTurnIntroduce = $("#isTurnIntroduce").val();
        var isFinishQuestionnaire = $("#isFinishQuestionnaire").val();
        var isJoinEarlyEducationCourse = $("#isJoinEarlyEducationCourse").val();
        var clientAssess = $("[name='clientAssess']").val();
        var joinSchoolWay = $("[name='joinSchoolWay']").val();
        var organizationElement = $("[name='organizationElement']").val();
        var potencyExploit = $("[name='potencyExploit']").val();
        var interstedCourse = $("[name='interstedCourse']").val();
        //请求接口
        ajaxRequest("tssStudentController/saveOrUpdate.do", {
            quickMark: quickMark,
            id: id,
            name: name,
            nickName: nickName,
            sex: sex,
            birthdayDate: birthdayDate,
            pertainRelationList: pertainRelationList,
            weiChat: weiChat,
            telePhone: telePhone,
            addressProvince: addressProvince,
            addressCity: addressCity,
            addressRegion: addressRegion,
            familyAddress: familyAddress,
            remark: remark,
            channelSource: channelSource,
            demanDegree: demanDegree,
            characters: characters,
            isTurnIntroduce: isTurnIntroduce,
            isFinishQuestionnaire: isFinishQuestionnaire,
            isJoinEarlyEducationCourse: isJoinEarlyEducationCourse,
            clientAssess: clientAssess,
            joinSchoolWay: joinSchoolWay,
            organizationElement: organizationElement,
            potencyExploit: potencyExploit,
            interstedCourse: interstedCourse
        }, function (html) {
            $(".submitBtn button").trigger("click");
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")

    }

    function inputValueLength(that,type) {
        if(type == 200){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,200}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 50){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,50}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 20){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,20}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 'name'){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,12}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }

        }
        if (type == 'englishNumber') {
            if (/[^\a-\z\A-\Z0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0,20));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'phone') {
            if (/[^0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,20}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if (type == 'telePhone') {
            if (/[^0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 12) {
                    $(that).val(that.value.substring(0,12));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'WeChat') {
            if (/[^\a-\z\A-\Z0-9_]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9_]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0,20));
                    logger.error("长度超过限制!");
                }
            }
        }
    }

</script>


